
package cn.cloud.all.security.oauth2.config.annotation;

import cn.cloud.all.security.oauth2.provider.ClientDetailsService;
import org.springframework.context.annotation.*;

@Configuration
public class ClientDetailsServiceConfiguration {

    @SuppressWarnings("rawtypes")
    private ClientDetailsServiceConfigurer configurer = new ClientDetailsServiceConfigurer(new ClientDetailsServiceBuilder());

    @Bean
    public ClientDetailsServiceConfigurer clientDetailsServiceConfigurer() {
        return configurer;
    }

    @Bean
    @Lazy
    @Scope(proxyMode = ScopedProxyMode.INTERFACES)
    public ClientDetailsService clientDetailsService() throws Exception {
        return configurer.and().build();
    }
}
